package com.everbest.framework.util;

public class WorkFlowSoftUtil {

    private static final int NUMBER_LENGTH = 8;
    private static final char ADD_STR = '0';

    /**
     * 生成带有前缀的编号
     * 
     * @param prefix
     * @param id
     * @return
     */
    public static String createNumber(String prefix, long id) {
        if (id == 0) {
            return "";
        }
        String strId = id + "";
        StringBuilder builder = new StringBuilder(strId);
        while (true) {
            int idLen = builder.length();
            if (idLen == NUMBER_LENGTH) {
                break;
            }
            builder.insert(0, ADD_STR);
        }
        builder.insert(0, prefix);
        return builder.toString();
    }

}
